<me:UIPRNDEF  x:Class="WPFExcelReport.TPCLTOOLS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
                   xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"
                    x:Name="TV"
                    Loaded="Window_Loaded"
                    >
    <me:UIPRNDEF.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:BoolToVisibilityConverter x:Key="bv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
    </me:UIPRNDEF.Resources>
    <TabControl>
        <TabItem Header="Pcl">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="1" >
                    <WrapPanel Margin="20,0,0.0,0" >
                        <Button Margin="25,0,0,0" Width="20" Height="20" Click="PrintCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Print.png" />
                            </Button.Background>
                        </Button>

                        <Button Margin="25,0,0,0" Width="20" Height="20" Click="PreviewCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Convert.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="Preview"/>
                        <ComboBox Text="{Binding ART,ElementName=TV}">
                            <ComboBoxItem Content=" D:\ITXRPRT\Documents\Print\06INTEX.087"/>
                            <ComboBoxItem Content="D:\ITXRPRT\Documents\Print\15HU.173"/>
                            <ComboBoxItem Content="D:\ITXRPRT\Documents\Print\03BLUM.159"/>
                            <ComboBoxItem Content="D:\ITXRPRT\Documents\Print\TONY.099"/>
                            <ComboBoxItem Content="D:\ITXRPRT\Documents\Print\09INTEX.880"/>
                        </ComboBox>
                        <TextBox Text="{Binding ART,ElementName=TV}"/>
                    </WrapPanel>
                    <TextBox Margin="10,0,0,0" Text="{Binding INFO,ElementName=TV}" />
                </StackPanel>
                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"/>
                    </Grid.ColumnDefinitions>
                    <Image Name="imgpriew"   
                            Source="{Binding Path=PHOTOLINK, ElementName=TV}" 
                   Grid.Column="1"   Stretch="None" 
                   VerticalAlignment="Top" Margin="0,0" />
                    <DataGrid  Grid.Column="0"  
                      Name="dlgMaster"
                      IsReadOnly="True"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="False"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                              HeadersVisibility="Column"
                       IsSynchronizedWithCurrentItem="True"
                              MaxHeight="700"
                                VerticalAlignment="Top"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="0.0,0,0.0,0"  
                              >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=ROWNID}" Header="{Binding Source={Localization:Translate Word=ID}}"  Width="Auto" MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=PRCOND}" Header="{Binding Source={Localization:Translate Word=Line}}"  Width="Auto" MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=PRCTYPE}" Header="{Binding Source={Localization:Translate Word=Command}}"  Width="Auto" MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=PRLX}" Header="{Binding Source={Localization:Translate Word=X}}"  Width="Auto" MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=PRLY}" Header="{Binding Source={Localization:Translate Word=Y}}"  Width="Auto" MinWidth="40"/>
                            <!--DataGridTextColumn Binding="{Binding Path=PRRX}" Header="{Binding Source={Localization:Translate Word=X}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=PRRY}" Header="{Binding Source={Localization:Translate Word=Y}}"  Width="Auto" MinWidth="40"/-->
                            <DataGridTextColumn Binding="{Binding Path=PRCONTENT, Converter={StaticResource ResourceKey=gb2312}}"
                                         Header="{Binding Source={Localization:Translate Word=Content}}"  Width="120" MinWidth="120"/>
                            <DataGridTextColumn Binding="{Binding Path=PRFONT, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=Font}}" 
                                         Width="40" />
                            <DataGridTextColumn Binding="{Binding Path=PRFONTSIZE}" Header="NexPos"  Width="Auto" MinWidth="40"/>

                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </Grid>
        </TabItem>
        <TabItem Header="Priview">
            <FlowDocument> 
                <Section>
                    <Paragraph>
                        <Image  Name="cImage" 
                       Source="{Binding Path=PHOTOLINK, ElementName=TV}" 
                       Stretch="Fill" 
                       />
                    </Paragraph> 
                </Section>               
            </FlowDocument>
        </TabItem>
    </TabControl>   
</me:UIPRNDEF>
